package com.spzx.cart.api;


import com.spzx.cart.api.domain.CartInfo;
import com.spzx.cart.api.factory.RemoteCartFallbackFactory;
import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(contextId = "remoteCartService",  value = "spzx-cart",fallbackFactory = RemoteCartFallbackFactory.class)
public interface RemoteCartService {

    @GetMapping("/cartList")
    public R<List<CartInfo>> cartList(@RequestHeader(SecurityConstants.FROM_SOURCE) String inner);

    @PutMapping("/updateCartPrice")
    R<Boolean> updateCartPrice(@RequestHeader(SecurityConstants.FROM_SOURCE) String inner);

    @DeleteMapping("/removeCheckedCart")
    R<Boolean> removeCheckedCart(@RequestHeader(SecurityConstants.FROM_SOURCE) String inner);
}
